
<template>
    <div class="information" style="width:240px;">
        <h3 class='title'>系统信息</h3>
        <div style="line-height:32px;"><span>{{$t("message.left.WebConsolePort")}}</span><el-input style="width:100%;" v-model="nWebConsolePort"></el-input></div>
        <!-- <div style="line-height:50px; display:flex; justify-content:space-between;"><span>{{$t("message.left.WebConsolePort")}} : &nbsp; </span><el-input style="width:80px;" v-model="nWebConsolePort"></el-input></div> -->
        <div style="line-height:50px; display:flex; justify-content:space-between;"><span>{{$t("message.left.OS")}}</span><span>{{data.strOSName}}</span></div>
        <div style="line-height:50px; display:flex; justify-content:space-between">
            <span>{{$t("message.left.H5SExtention")}}</span>
            <el-switch
                v-model="data.bExtSupport"
                disabled
                style="padding-top:26px;"
                active-color="#13ce66"
                inactive-color="#ff4949">
            </el-switch>
            </div>
        <div style="line-height:50px; display:flex; justify-content:space-between">
            <span>{{$t("message.left.WebConsole")}}</span>
            <el-switch
                v-model="data.bWebConsoleSupport"
                disabled
                style="padding-top:26px;"
                active-color="#13ce66"
                inactive-color="#ff4949">
            </el-switch>
        </div>
        <el-button style="width:100%;margin-top:10px;" size='small' type="primary" @click="save"> 保存</el-button>
    </div>
</template>
<script>
//系统信息
export default {
    data(){
        return{
            data:{},
            nWebConsolePort:'',
        }
    },
    methods:{
        datalist(){
            console.log(this.$store.state.IPPORT);
            let url = this.$store.state.IPPORT + "/api/v1/GetAdvSystemInfo?session="+ this.$store.state.token;
            console.log(url);
            this.$http.get(url).then(result=>{
                if (result.status == 200){
                    this.data =  result.data;
                    this.nWebConsolePort=this.data.nWebConsolePort;
                    this.$store.state.webconsole = this.data.bWebConsoleSupport;
                    console.log(this.data);
                } 
            }).catch((err) =>{
                console.log('GetSrc failed', err);
            })
        },
        save(){
            console.log(this.nWebConsolePort);
            let url = this.$store.state.IPPORT + "/api/v1/SetAdvWebConsolePort?session="+ this.$store.state.token+"&port="+this.nWebConsolePort;
            console.log(url);
            this.$http.get(url).then(result=>{
                if (result.status == 200){
                    alert('保存成功')
                } 
            }).catch((err) =>{
                console.log('GetSrc failed', err);
            })
        }

	},
	mounted(){
        this.datalist();
	},
}
</script>
<style lang="scss" scoped>
.information{
    height: 87vh;
    padding-left: 10px;
    div{
        color: azure;
        font-size: 16px;
    }
    .title{
        padding: 10px 0;
    }
}
</style>